# -*- coding: utf-8 -*-
"""
Created on Fri Jun 16 13:50:01 2017

@author: qiang.qian
"""

import pandas as pd

import numpy as np

import statsmodels.api as sm

import statsmodels.formula.api as smf


df_adv=pd.read_csv('D:\\mycode\\oschina\\pyone\\orders.txt',index_col=0)

X=df_adv[['user_1_30','user_31_60','user_61_90','user_90_']]

y=df_adv['orders']
 
X=sm.add_constant(X)

est=sm.OLS(y,X).fit()

est=smf.ols(formula='orders ~ user_1_30+user_31_60+user_61_90+user_90_',data=df_adv).fit()

